package cn.com.connext.scrm.client;

import cn.com.connext.scrm.domain.master.Member;
import cn.com.connext.scrm.service.dto.ScoreLogDTO;
import cn.com.connext.scrm.service.dto.ScoreLogVM;
import cn.com.connext.scrm.service.dto.WhiskyDTO;
import cn.com.connext.scrm.web.rest.vm.NoteIdVM;
import cn.com.connext.scrm.web.rest.vm.UnionIdVM;
import cn.com.connext.scrm.web.rest.vm.WantDrinkVM;
import com.connext.common.client.AuthorizedFeignClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@AuthorizedFeignClient(name = "member-center", fallback = MemberClientFallBack.class)
public interface MemberClient {

    Logger LOG = LoggerFactory.getLogger(MemberClient.class);

    @RequestMapping(value = "/api/score/saveScore", method = RequestMethod.POST)
    ResponseEntity saveScore(@RequestBody List<ScoreLogVM> productRate);

    @RequestMapping(value = "/api/score/findByNoteId", method = RequestMethod.GET)
    List<ScoreLogDTO> findAllScoreByNoteId(@RequestParam("noteId") String noteId);

    @RequestMapping(value = "/api/goods/findById", method = RequestMethod.GET)
    WhiskyDTO findById(@RequestParam("id") String goodId);

    @RequestMapping(value = "/api/member/getAll", method = RequestMethod.POST)
    List<String> findAllOpenId();

    @RequestMapping(value = "/api/score/findNoteIdByGoodsId", method = RequestMethod.GET)
    List<String> findNoteIdByGoodsId(@RequestParam("goodId") String goodId);

    @RequestMapping(value = "/api/goods/wineList/drink", method = RequestMethod.POST)
    void drink(@RequestBody WantDrinkVM vm);

    @RequestMapping(value = "/api/member/getUser", method = RequestMethod.POST)
    Member findMemberByUserId(@RequestBody UnionIdVM userId);

    @RequestMapping(value = "/api/score/deleteByNoteId")
    void deleteScoreByNoteId(@RequestBody NoteIdVM vm);
}
